<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        {{value}}
        <!-- 键盘按下enter(回车)的时候来进行触发 -->
        <!-- <input type="text" v-model="value" v-on:keyup.enter="open"> -->
        <input type="text" v-model="value" @keyup.enter="open">
    </div>
</body>
</html>
<script>
    new Vue({
        el:"#app",
        data(){
            return {
                value:""
            }
        },
        //用来存放方法
        methods:{
            open(){
                alert("用户输入的值为："+this.value)
            }
        }
    })

</script>